package com.atguigu.gmall.publisher.mapper;

import com.atguigu.gmall.publisher.bean.IsNewVisitorTypeStats;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface IsNewVisitorTypeStatsMapper {
    @Select("select\n" +
            "isNew,\n" +
            "sum(isUnique) uv_ct,\n" +
            "sum(pagesCount) pv_ct,\n" +
            "sum(sidCount) sv_ct,\n" +
            "sum(jumpCount) uj_ct,\n" +
            "sum(duringTime) dur_sum\n" +
            "from dws_sc_pc_adt_apc\n" +
            "where toYYYYMMDD(stt) =#{date}\n" +
            "group by isNew ;")
    List<IsNewVisitorTypeStats> selectVisitorTypeStats(@Param(value = "date")Integer date);

}
